package com.ys.service.Impl;

import com.ys.mapper.OrderMapper;
import com.ys.pojo.Order;
import com.ys.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;

@Service("OrderService")
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderMapper orderMapper;
    @Override
    public List<Order> OrderList(Order order) {
        return orderMapper.OrderList(order);
    }

    @Override
    public boolean addsa(Order order) {
        return orderMapper.addsa(order);
    }

    @Override
    public boolean deltes(Integer id) {
        return orderMapper.deltes(id);
    }
    /**
     * 查询全部为购买的订单
     * @return
     */
    @Override
    public List<Order> searchBuyAll(String name1, String name2,String name3,String name4) {
        return orderMapper.findBuyAll(name1,name2,name3,name4);
    }
    @Override
    public List<Order> searchAll() {
        return orderMapper.findAll();
    }

    @Override
    public List<Order> searchType(String types) {
        return orderMapper.findTypes(types);
    }

    @Override
    public List<Order> searchDate(LocalDate goumaishijian) {
        return orderMapper.findDate(goumaishijian);
    }
}
